In a control apparatus for a machine tool, an automatic operation mode and an MDI (manual data input, Manual Data Input) mode are set. In the automatic operation mode, an NC program is stored in association with a program number or a program name. When an operator specifies a program number, a machine tool is automatically operated on the basis of a corresponding NC program. In the MDI mode, an NC program is not stored, and the operator each time inputs the program statement of an NC program character by character while performing execution. In the MDI mode, the input NC program is deleted when it is once executed or the MDI mode is shifted to a different mode. In the present application, an NC program stored in the automatic operation mode is called a machining NC program and an NC program input in the MDI mode is called an operation NC program (MDI program).
Patent Literature 1 discloses a numerical control device that is capable of adding a predetermined program number and storing one MDI program, which is being edited, as a backup program in an NC program memory, and resuming editing of the one MDI program by producing a copy from the NC program memory to an MDI program memory.